<?php
/**
 * 兼容第三方插件补丁文件
 * @来自第三方接口文件
 */
	defined('BY_JYA') or exit('error');
	list($goods)=$arguments;
	if($_SESSION['onemerchid']){
		$setting=plugin('jy_goodsfwmerch')->plugin_setting('secury'.$_SESSION['onemerchid']);
	}else{
		$setting=$this->plugin_setting('secury');
	}
	if(!$setting['goods']){
		$setting['goods']=10;
		exi('请先设置好-参数设置--商品编号！','error');
	}
	do{
		$code=rand(pow(10,($setting['goods']-1)), pow(10,$setting['goods'])-1);
		$v=pdo_get('jy_goodsfw_goods',array('code'=>$code));
	}while($v);
	$goods['code']=$code;
	if(!$goods['type']){
		$goods['type']=2;
	}
	$goods['uniacid']=$_SESSION['uniacid'];
	pdo_insert('jy_goodsfw_goods',$goods);
	$id=pdo_insertid();
	return $id;
	

